﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Micua.iChat.ViewModels;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// “空白页”项模板在 http://go.microsoft.com/fwlink/?LinkID=390556 上有介绍

namespace Micua.iChat.Views
{
    /// <summary>
    /// 可用于自身或导航至 Frame 内部的空白页。
    /// </summary>
    public sealed partial class LoginPage : Page
    {
        public LoginViewModel ViewModel { get; set; }
        public LoginPage()
        {
            ViewModel = new LoginViewModel();
            this.InitializeComponent();
        }

        /// <summary>
        /// 在此页将要在 Frame 中显示时进行调用。
        /// </summary>
        /// <param name="e">描述如何访问此页的事件数据。
        /// 此参数通常用于配置页。</param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            fadeIn.Begin();

            // 设置提示文本为空字符串（必须）
            Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ProgressIndicator.Text = " ";
            // 设定进度值为0（必须）
            Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ProgressIndicator.ProgressValue = 0;
            // 显示加载状态
            await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ProgressIndicator.ShowAsync();
            // 隐藏当前状态栏
            //await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
        }
    }
}
